package ro.gillardon.commons.dto;

import java.time.LocalDate;
import java.util.Date;

import ro.gillardon.commons.enums.City;
import ro.gillardon.commons.enums.Hotel;
import ro.gillardon.commons.enums.RoomType;
import ro.gillardon.commons.util.DateUtils;
/**
 * Contains methods and details needed in user interface.
 */
public class HotelDTO {

  private City location;
  private Hotel name;
  private LocalDate start;
  private LocalDate end;
  private RoomType roomType;

  /**
   * Instantiates a new HotelUI.
   */
  public HotelDTO() {
    this.location = City.BRETTEN;
    this.name = Hotel.ACHAT_BRETTEN;
    this.start = LocalDate.now();
    this.end = LocalDate.now();
    this.roomType = RoomType.SINGLE;
  }

  public LocalDate getStartingDate() {
    return this.start;
  }

  public LocalDate getEndingDate() {
    return this.end;
  }

  public String getLocation() {
    return this.location.toString();
  }

  public void setLocation(final String location) {
    this.location = City.valueOf(location);
  }

  public String getName() {
    return this.name.toString();
  }

  public void setName(final String name) {
    this.name = Hotel.valueOf(name);
  }

  public Date getStart() {
    return DateUtils.convertToDate(this.start);
  }

  public void setStart(final Date start) {
    this.start = DateUtils.convertToLocalDate(start);
  }

  public Date getEnd() {
    return DateUtils.convertToDate(this.end);
  }

  public void setEnd(final Date end) {
    this.end = DateUtils.convertToLocalDate(end);
  }

  public String getRoomType() {
    return this.roomType.toString();
  }

  public void setRoomType(final String roomType) {
    this.roomType = RoomType.valueOf(roomType);
  }

}
